package com.example.yuanboot.common.enums.system;

import lombok.Getter;

/**
 * 账号状态枚举
 *
 * @author qingyan 2021-09-27
 */
@Getter
public enum AccountStatusEnum {

    NORMAL(1,"正常"),
    DISABLED(0,"禁止"),
    ;

    private final int state;
    private final String desc;

    AccountStatusEnum(int state, String desc) {
        this.state = state;
        this.desc = desc;
    }

    public static String getDesc(int state) {
        for (AccountStatusEnum value : values()) {
            if (value.getState() == state) {
                return value.getDesc();
            }
        }
        return "";
    }
}
